import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('../views/IndexView.vue'),
    },
    {
      path: '/accessoriesFactoryView',
      name: 'AccessoriesFactoryView',
      component: () => import('../views/AccessoriesFactoryView.vue')
    },
    {
      path: '/internetResourcesView',
      name: 'InternetResourcesView',
      component: () => import('../views/InternetResourcesView.vue')
    },
    {
      path: '/bigDataAnalysisView',
      name: 'BigDataAnalysisView',
      component: () => import('../views/BigDataAnalysisView.vue')
    },
    {
      path: '/baseMapView',
      name: 'BaseMapView',
      component: () => import('../views/BaseMapView.vue')
    },
    {
      path: '/multidimensionalAnalysisView',
      name: 'MultidimensionalAnalysisView',
      component: () => import('../views/MultidimensionalAnalysisView.vue')
    },
    {
      path: '/dataResourcesView',
      name: 'DataResourcesView',
      component: () => import('../views/DataResourcesView.vue')
    },
    {
      path: '/managementSystemView',
      name: 'ManagementSystemView',
      component: () => import('../views/ManagementSystemView.vue')
    },
    {
      path: '/dataExhibitionView',
      name: 'DataExhibitionView',
      component: () => import('../views/DataExhibitionView.vue')
    },
    {
      path: '/produceListView',
      name: 'ProduceListView',
      component: () => import('../views/ProduceListView.vue')
    },
    {
      path: '/expressInformationView',
      name: 'ExpressInformationView',
      component: () => import('../views/ExpressInformationView.vue')
    },
    {
      path: '/enterpriseEndView',
      name: 'EnterpriseEndView',
      component: () => import('../views/EnterpriseEndView.vue')
    },
    {
      path: '/realTimeMonitoringView',
      name: 'RealTimeMonitoringView',
      component: () => import('../views/RealTimeMonitoringView.vue')
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    }
  ]
})

// router.beforeEach((to) => {
//   if (to.path !== '/login' && to.path != '/') return '/login'
// })

export default router
